Let the application decide whether to create an app instance#59
Merged
dspencer001 merged 5 commits intomainfrom Oct 10, 2025
Merged
Let the application decide whether to create an app instance#59dspencer001 merged 5 commits intomainfrom
dspencer001 merged 5 commits intomainfrom
Conversation
dspencer001
commented
Oct 7, 2025
dspencer001
commented
Oct 7, 2025
dspencer001
commented
Oct 7, 2025
dspencer001
commented
Oct 7, 2025
These come after the custom and default strategies, and can be used by the application to optionally create new ApplicationInstance records on launch, or do something else in the case where we weren't able to find the ApplicationInstance record for the LTI launch.
e7ac921 to
55f17c2
Compare
mpetrowi
approved these changes
Oct 8, 2025
Contributor
mpetrowi
left a comment
There was a problem hiding this comment.
LGTM. I like that we're using the existing strategies
The application will still have to provide a custom strategy, but at least most of the logic is contained in the gem now.
mpetrowi
reviewed
Oct 8, 2025
| gsub(/[^\w]+/, "_") # Replace non alphanumeric characters with _ | ||
|
|
||
| old_tenant = "#{site_key}-#{current_application.key}" | ||
| app_instance = ApplicationInstance.find_by(tenant: old_tenant, application: current_application) |
Contributor
There was a problem hiding this comment.
Should we check the new style first and then fall back to legacy search using a method that can be defined in the ap? AA might need extra logic here as well
Contributor
Author
There was a problem hiding this comment.
I think this just has to be all custom by the application. The new tenant system that replaces Apartment has tenant as belongs_to, not just a field, so this wouldn't work for those applications
Also moves more to be implemented by the application.
mpetrowi
approved these changes
Oct 8, 2025
mpetrowi
approved these changes
Oct 8, 2025
find_existing is redundant, so is create_new. Instead call it exactly what we're finding/creating
seanrcollings
approved these changes
Oct 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of erroring, permit the application to intervene and create an application instance. This lets us create tenants better in the case of dynamic registration installs, where we don't necessarily have the information necessary to create the application instance immediately.